import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:pornhub_app/assets/styles.dart';
import 'package:pornhub_app/components/image_view.dart';
import 'package:pornhub_app/model/engagement/engagement_model.dart';
import 'package:pornhub_app/routes/routes.dart';
import 'package:pornhub_app/utils/color.dart';
import 'package:pornhub_app/utils/extension.dart';
import 'package:pornhub_app/utils/utils.dart';

class LouFengCell extends StatelessWidget {
  final EngagementModel data;

  const LouFengCell({super.key, required this.data});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        ImageView(
          src: data.logo ?? '',
          width: 170.w,
          height: 170.w,
          borderRadius: Styles.borderRaidus.xs,
        ).marginOnly(right: 12.w),
        Expanded(
            child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text(
              data.nickName ?? '',
              maxLines: 1,
              softWrap: true,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  color: COLOR.hexColor('#333333'),
                  fontSize: 14.w,
                  fontWeight: FontWeight.w600),
            ),
            SizedBox(height: 10.w),
            Text(
              '地址：${data.cityName ?? ''}',
              maxLines: 1,
              softWrap: true,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  color: COLOR.hexColor('#666666'),
                  fontSize: 12.w,
                  fontWeight: FontWeight.w400),
            ),
            SizedBox(height: 8.w),
            Text(
              '价格：${data.price?.toInt()}/p ${data.nightPrice?.toInt()}/包夜',
              maxLines: 1,
              softWrap: true,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  color: COLOR.hexColor('#DD001B'),
                  fontSize: 12.w,
                  fontWeight: FontWeight.w600),
            ),
            SizedBox(height: 8.w),
            Text(
              '服务项目：${data.serviceTags?.join(',')}',
              maxLines: 2,
              softWrap: true,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  color: COLOR.hexColor('#666666'),
                  fontSize: 12.w,
                  fontWeight: FontWeight.w400),
            ),
            SizedBox(height: 18.w),
            Text(
              '${Utils.dateFmt(data.updatedAt ?? '', ['mm', '-', 'dd'])}更新',
              maxLines: 1,
              softWrap: true,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  color: COLOR.hexColor('#666666'),
                  fontSize: 10.w,
                  fontWeight: FontWeight.w400),
            ),
          ],
        )),
      ],
    ).marginOnly(left: 14.w, bottom: 20.w, right: 14.w).onOpaqueTap(() {
      Get.toEngagementDetail(meetUserId: data.meetUserId ?? 0);
    });
  }
}
